#ifndef SPRITE_H_
#define SPRITE_H_

#include "Vector2D.h"
#include "TextureManager.h"

class Sprite
{
	protected:
	float birthTime;
	float lifespan;
	float deathTime;
	
	Vector2D startSize;
	Vector2D endSize;
	Vector2D sizeDelta;
	TextureManager * textureManager;
	int textureIndex;
	Vector2D * textureVertices;
	
	public:
	int spriteId;
	float boundingRadius;
	Vector2D position;
	Sprite();
	Sprite(Vector2D position, Vector2D size, float lifespan);
	Sprite(Vector2D position, Vector2D startSize, Vector2D endSize, float lifespan);
	Sprite(Vector2D position, Vector2D size, float lifespan, TextureManager * textureManager, char * filename);
	Sprite(Vector2D position, Vector2D startSize, Vector2D endSize, float lifespan, TextureManager * textureManager, char * filename);
	Sprite(Vector2D position, Vector2D size, float lifespan, TextureManager * textureManager, char * filename, int spriteId);
	virtual ~Sprite();
	void Draw();
	Vector2D GetVertex(int index);
	bool IsDead();
	void ProjectPolygon(Vector2D axis, float * min, float * max, Vector2D * minVertex, Vector2D * maxVertex, float * minError, float * maxError);
	virtual void SpriteDrawEntryPoint();
	virtual void Think(double elapsedTime);
};
#endif /*SPRITE_H_*/
